how to convert string to csv file in python